import axios from "./axios.js";

let id = 1;

function request(data) {
  data.jsonrpc = "2.0";
  data.id = id++;
  return axios.post(`/rpc`, data);
}

export default {
  login(data) {
    data.method = "login";
    return request(data);
  },
  alive(data) {
    data.method = "alive";
    return request(data);
  },
  query_areas(data) {
    data.method = "query_areas";
    return request(data);
  },
  delete_area(data) {
    data.method = "delete_area";
    return request(data);
  },
  update_areas(data) {
    data.method = "update_areas";
    return request(data);
  },
  add_area(data) {
    data.method = "add_area";
    return request(data);
  },
  set_vrv_ip(data) {
    data.method = "set_vrv_ip";
    return request(data);
  },
  get_gw_id(data) {
    data.method = "get_gw_id";
    return request(data);
  },
  enabled_join_gateway(data) {
    data.method = "enabled_join_gateway";
    return request(data);
  },
  disabled_join_gateway(data) {
    data.method = "disabled_join_gateway";
    return request(data);
  },

  query_cloud_platform_info(data) {
    data.method = "query_cloud_platform_info";
    return request(data);
  },
  unbind_cloud_account(data) {
    data.method = "unbind_cloud_account";
    return request(data);
  },
  romalink_config_cloud_secret_key(data) {
    data.method = "romalink_config_cloud_secret_key";
    return request(data);
  },
  romalink_commit_config(data) {
    data.method = "romalink_commit_config";
    return request(data);
  },
  romalink_reset_cloud_config(data) {
    data.method = "romalink_reset_cloud_config";
    return request(data);
  },
  romalink_config_cloud_addr(data) {
    data.method = "romalink_config_cloud_addr";
    return request(data);
  },
  get_network_info(data) {
    data.method = "get_network_info";
    return request(data);
  },
  scan_wifi(data) {
    data.method = "scan_wifi";
    return request(data);
  },
  is_wifi_enable(data) {
    data.method = "is_wifi_enable";
    return request(data);
  },
  enable_wifi(data) {
    data.method = "enable_wifi";
    return request(data);
  },
  disconnect_wifi(data) {
    data.method = "disconnect_wifi";
    return request(data);
  },
  set_network_infos(data) {
    data.method = "set_network_infos";
    return request(data);
  },
  get_local_gw_info(data) {
    data.method = "get_local_gw_info";
    return request(data);
  },
  check_update(data) {
    data.method = "check_update";
    return request(data);
  },
  set_gw_name(data) {
    data.method = "set_gw_name";
    return request(data);
  },
  set_password(data) {
    data.method = "call";
    return request(data);
  },
  get_gw_work_mode_info(data) {
    data.method = "get_gw_work_mode_info";
    return request(data);
  },
  set_gw_work_mode_info(data) {
    data.method = "set_gw_work_mode_info";
    return request(data);
  },
  unbind_gw_relation(data) {
    data.method = "unbind_gw_relation";
    return request(data);
  },
  connect_wifi(data) {
    data.method = "connect_wifi";
    return request(data);
  },
  gw_reboot(data) {
    data.method = "gw_reboot";
    return request(data);
  },
  restore_sta_mode(data) {
    data.method = "restore_sta_mode";
    return request(data);
  },
  gw_reset(data) {
    data.method = "gw_reset";
    return request(data);
  },
  query_all_device_detail(data) {
    data.method = "query_all_device_detail";
    return request(data);
  },
  query_all_group_detail(data) {
    data.method = "query_all_group_detail";
    return request(data);
  },
  query_all_scene_detail_ex2(data) {
    data.method = "query_all_scene_detail_ex2";
    return request(data);
  },
  set_panel_button_infos(data) {
    data.method = "set_panel_button_infos";
    return request(data);
  },
  query_automation_list(data) {
    data.method = "query_automation_list";
    return request(data);
  },
  query_automation_detail(data) {
    data.method = "query_automation_detail";
    return request(data);
  },
  add_group(data) {
    data.method = "add_group";
    return request(data);
  },
  strict_save_groups_detail(data) {
    data.method = "strict_save_groups_detail";
    return request(data);
  },
  update_group(data) {
    data.method = "update_group";
    return request(data);
  },
  update_groups_detail(data) {
    data.method = "update_groups_detail";
    return request(data);
  },
  delete_groups(data) {
    data.method = "delete_groups";
    return request(data);
  },
  get_topo_info(data) {
    data.method = "get_topo_info";
    return request(data);
  },
  get_group_type_info_list(data) {
    data.method = "get_group_type_info_list";
    return request(data);
  },
  get_dev_type_info_list(data) {
    data.method = "get_dev_type_info_list";
    return request(data);
  },
  get_binding_info_list(data) {
    data.method = "get_binding_info_list";
    return request(data);
  },
  get_binding_info_list_with_cmd(data) {
    data.method = "get_binding_info_list";
    return request(data);
  },
  get_web_dev_property_list(data) {
    data.method = "get_web_dev_property_list";
    return request(data);
  },
  strict_save_scenes_detail_ex2(data) {
    data.method = "strict_save_scenes_detail_ex2";
    return request(data);
  },
  exec_scene(data) {
    data.method = "strict_save_scenes_detail_ex2";
    return request(data);
  },
  get_automation_info_list(data) {
    data.method = "get_automation_info_list";
    return request(data);
  },
  delete_scene(data) {
    data.method = "delete_scene";
    return request(data);
  },
  add_scene(data) {
    data.method = "add_scene";
    return request(data);
  },
  // eslint-disable-next-line no-dupe-keys
  exec_scene(data) {
    data.method = "exec_scene";
    return request(data);
  },
  query_all_execute_device_detail(data) {
    data.method = "query_all_execute_device_detail";
    return request(data);
  },
  query_all_interactive_device_detail(data) {
    data.method = "query_all_interactive_device_detail";
    return request(data);
  },
  exc(data) {
    data.method = "query_all_execute_device_ep_detail";
    return request(data);
  },
  query_all_not_interactive_device_ep_detail(data) {
    data.method = "query_all_not_interactive_device_ep_detail";
    return request(data);
  },
  update_scene(data) {
    data.method = "update_scene";
    return request(data);
  },
  query_scene(data) {
    data.method = "update_scene";
    return request(data);
  },
  send_command_data(data) {
    data.method = "send_command_data";
    return request(data);
  },
  device_set_curtain_run_mode(data) {
    data.method = "device_set_curtain_run_mode";
    return request(data);
  },
  device_set_curtain_travel(data) {
    data.method = "device_set_curtain_travel";
    return request(data);
  },
  device_delete_curtain_travel(data) {
    data.method = "device_delete_curtain_travel";
    return request(data);
  },
  device_set_sensor_sensitivity(data) {
    data.method = "device_set_sensor_sensitivity";
    return request(data);
  },
  device_set_sensor_out_delay(data) {
    data.method = "device_set_sensor_out_delay";
    return request(data);
  },
  modify_ep_type(data) {
    data.method = "modify_ep_type";
    return request(data);
  },
  delete_devices(data) {
    data.method = "delete_devices";
    return request(data);
  },
  update_devices_detail(data) {
    data.method = "update_devices_detail";
    return request(data);
  },
  // eslint-disable-next-line no-dupe-keys
  get_binding_info_list(data) {
    data.method = "get_binding_info_list";
    return request(data);
  },
  delete_automations(data) {
    data.method = "delete_automations";
    return request(data);
  },
  strict_save_automations_detail(data) {
    data.method = "strict_save_automations_detail";
    return request(data);
  },
  query_all_automation_condition_device_ep_detail(data) {
    data.method = "query_all_automation_condition_device_ep_detail";
    return request(data);
  },
  add_automation(data) {
    data.method = "add_automation";
    return request(data);
  },
  copy_automation_detail(data) {
    data.method = "copy_automation_detail";
    return request(data);
  },
  query_device_bind_interactive_objs(data) {
    data.method = "query_device_bind_interactive_objs";
    return request(data);
  },
  update_or_add_bindings(data) {
    data.method = "update_or_add_bindings";
    return request(data);
  },
  update_or_add_bindings2(data) {
    data.method = "update_or_add_bindings_2";
    return request(data);
  },
  query_all_execute_device_ep_detail_by_group_type(data) {
    data.method = "query_all_execute_device_ep_detail_by_group_type";
    return request(data);
  },
  // eslint-disable-next-line no-dupe-keys
  set_panel_button_infos(data) {
    data.method = "set_panel_button_infos";
    return request(data);
  },
  get_all_device_count(data) {
    data.method = "get_all_device_count";
    return request(data);
  },
  // eslint-disable-next-line no-dupe-keys
  unbind_gw_relation(data) {
    data.method = "unbind_gw_relation";
    return request(data);
  },
  update_automation(data) {
    data.method = "update_automation";
    return request(data);
  },
  query_all_not_execute_device_detail(data) {
    data.method = "query_all_not_execute_device_detail";
    return request(data);
  },
  update_device_ep_detail(data) {
    data.method = "update_device_ep_detail";
    return request(data);
  },
  update_device_button_name(data) {
    data.method = "update_device_button_name";
    return request(data);
  },
  get_device_online_count(data) {
    data.method = "get_device_online_count";
    return request(data);
  },
  query_all_device_by_area_id(data) {
    data.method = "query_all_device_by_area_id";
    return request(data);
  },
  export_config(data) {
    data.method = "export_config";
    return request(data);
  },
  import_config(data) {
    data.method = "import_config";
    return request(data);
  },
  get_device_online_count_by_area_id(data) {
    data.method = "get_device_online_count_by_area_id";
    return request(data);
  },
  delete_group_device_by_id(data) {
    data.method = "delete_group_device_by_id";
    return request(data);
  },
  query_all_device_ep_by_area_id(data) {
    data.method = "query_all_device_ep_by_area_id";
    return request(data);
  },
};
